<?php

class Article_to {
 
	private $number;
	private $title;
	private $autor_login;
	private $date;
	private $state;
	private $view;
		
	
	
	public function __construct($number, $title, $autor_login, $date, $state, $view) {
		
		$this->number =  $number;
		$this->title = $title;
		$this->autor_login = $autor_login;
		$this->date = $date;
		$this->state = $state;
		$this->view = $view;
		
	}
	
	
	public function get_number() {
		return $this->number; 
	}

	public function get_title() {
		return $this->title; 
	}	
	public function set_title($title) {
		$this->title = $title;
	}
	public function get_autor_login() {
		return $this->autor_login; 
	}
	
	public function get_date() {
		return $this->date; 
	}

	public function get_state() {
		return $this->state; 
	}
	public function set_state($state) {
		$this->state = $state;
	}
	public function get_view() {
		return $this->view; 
	}
	public function set_view($view) {
		$this->view = $view;
	}	

	
	
	public function equals($object) {	
		if ((get_class($this) != get_class($object)) ||
				($object == null))				
			 return false;
		else {
			if (($this->number == $object->get_number()) &&
				($this->title == $object->get_title()) &&
				($this->autor_login == $object->get_autor_login()) &&
				($this->date == $object->get_date()) &&
				($this->state == $object->get_state()) &&
				($this->view == $object->get_view()))
				return true;				
			return false;
		}
	}
	
	
	public function to_string() {
		return 'number: ' . $this->number . ' | ' . 
				'title: ' . $this->title . ' | ' .
				'autor_login: ' . $this->autor_login . ' | ' .		
				'date: ' . $this->date . ' | ' .
				'state: ' . $this->state . ' | ' .
				'view: ' . $this->view;				
	}
}

?>